package Activity.Demo;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class SecondActivity extends Activity {
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {

		
		//Called super onCreate method
		super.onCreate(savedInstanceState);
		this.setContentView(R.layout.secondactivity);
		
		String valueStr = this.getIntent().getStringExtra("parameter1").toString();
		EditText editText = (EditText)this.findViewById(R.id.editText);
		editText.setText(valueStr);
		
		
		Button btnStartThreedActivity = (Button)this.findViewById(R.id.btnStartThreedActivity);
		btnStartThreedActivity.setOnClickListener(new View.OnClickListener() {
			
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent(SecondActivity.this, ThreedActivity.class);
				SecondActivity.this.startActivity(intent);
			}
		});
		
		Log.v("CycleLife", "SecondActivity -> onCreate");
	}
	
	@Override
	protected void onSaveInstanceState(Bundle outState) {
		super.onSaveInstanceState(outState);
		
		Log.v("CycleLife", "SecondActivity -> onSaveInstanceState()");
	}

	@Override
	protected void onRestoreInstanceState(Bundle savedInstanceState) {
		super.onRestoreInstanceState(savedInstanceState);
		Log.v("CycleLife", "SecondActivity -> onRestoreInstanceState()");
	}
	
	@Override
	protected void onDestroy() {
		super.onDestroy();
		Log.v("CycleLife", "SecondActivity -> onDestroy()");
	}

	@Override
	protected void onPause() {
		// TODO Auto-generated method stub
		super.onPause();
		Log.v("CycleLife", "SecondActivity -> onPause()");
	}

	@Override
	protected void onRestart() {
		// TODO Auto-generated method stub
		super.onRestart();
		Log.v("CycleLife", "SecondActivity -> onRestart()");
	}

	@Override
	protected void onResume() {
		// TODO Auto-generated method stub
		super.onResume();
		Log.v("CycleLife", "SecondActivity -> onResume()");
	}

	@Override
	protected void onStart() {
		// TODO Auto-generated method stub
		super.onStart();
		Log.v("CycleLife", "SecondActivity -> onStart()");
	}

	@Override
	protected void onStop() {
		// TODO Auto-generated method stub
		super.onStop();
		Log.v("CycleLife", "SecondActivity -> onStop()");
	}
	
}
